﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormDesigner.MyControls
{
    public partial class MyGroupBox : MyControl
    {
        [Browsable(true)]
        [Category("MyControl")]
        public GroupBox GroupBox { get; } = new GroupBox() { Dock = DockStyle.Fill, Text = "groupbox" };

        public MyGroupBox()
        {
            InitializeComponent();

            Load += MyGroupBox_Load;
        }

        private void MyGroupBox_Load(object? sender, EventArgs e)
        {
            panel.Controls.Add(GroupBox);

            GroupBox.Click += GroupBox_Click;
        }

        private void GroupBox_Click(object? sender, EventArgs e)
        {
            PropertyGrid.SelectedObject = this;
            Focus();
        }
    }
}
